home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-07-16 | 1.4 KB | 50 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CMyCaption.cp ©1995-97 Timo Eloranta All rights reserved.
- // ===========================================================================
- // A subclass of LCaption which uses TETextBox for drawing just like
- // LCaption did before this changed in CW7...
-
- #include "CMyCaption.h"
- #include <LStream.h>
- #include <UDrawingUtils.h>
- #include <UTextTraits.h>
-
- #ifndef __TEXTUTILS__
- #include <TextUtils.h>
- #endif
-
- // ---------------------------------------------------------------------------
- // • CMyCaption( LStream* )
- //
- // Called by: URegistrar::CreateObject
- // ---------------------------------------------------------------------------
- // Construct from data in a Stream
-
- CMyCaption::CMyCaption( LStream *inStream)
- : LCaption( inStream )
- {
- }
-
- // ---------------------------------------------------------------------------
- // • DrawSelf
- // ---------------------------------------------------------------------------
- // Draw the Caption
-
- void
- CMyCaption::DrawSelf()
- {
- Rect frame;
- CalcLocalFrameRect(frame);
-
- Int16 just = UTextTraits::SetPortTextTraits(mTxtrID);
-
- RGBColor textColor;
- ::GetForeColor(&textColor);
-
- ApplyForeAndBackColors();
- ::RGBForeColor(&textColor);
-
- ::TETextBox((Ptr)&mText[1], mText[0], &frame, just); // The difference
- // UTextDrawing::DrawWithJustification((Ptr)&mText[1], mText[0], frame, just);
- }
-